package org.holynite.fieldmanage.types

/**
 * Created by midnite on 15/1/12.
 */
enum Privileges {
	Administration("admin", "priAdmin"),
	DailyRuns("daily", "priDaily"),
	CustomerAffairs("customer", "priCustomer"),
	Cashier("cash", "priCashier"),
	Selling("selling", "priSelling"),
	Storage("storage", "priStorage"),
	Statistics("manage", "priManage")

	final String codeSign, localeSign
	Privileges(String codeSign, String localeSign) {
		this.codeSign = codeSign
		this.localeSign = localeSign
	}

    static Privileges findByCodeSign(String code) {
        Privileges.values().find { v ->
            v.codeSign.equals(code)
        }
    }
}